﻿@using EasyXaf.EntityDesigner.Editors.DetailViewEditors.Models

<div id="@EntityTreeId" class="@CssClass">
    <DxTreeView @ref="EntityTree"
                CssClass="w-100 h-100"
                Data="Nodes"
                TextWrapEnabled="false"
                LoadChildNodesOnDemand="true"
                AfterExpand="async (e) => await InitSortableAsync()">
        <DataMappings>
            <DxTreeViewDataMapping HasChildren="@(nameof(EntityTreeNode.HasChildren))"
                                   Children="@(nameof(EntityTreeNode.Children))"
                                   IconUrl="@(nameof(EntityTreeNode.ImageUrl))"
                                   CssClass="@(nameof(EntityTreeNode.CssClass))"
                                   Text="@(nameof(EntityTreeNode.Text))"
                                   Name="@(nameof(EntityTreeNode.Name))"/>
        </DataMappings>
    </DxTreeView>
</div>